package cn.iocoder.yudao.module.crm.controller.admin.customer.vo.customer;

import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.annotations.ExcelColumnSelect;
import cn.iocoder.yudao.framework.excel.core.convert.AreaConvert;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import cn.iocoder.yudao.module.crm.convert.ExcelListDataCovert;
import cn.iocoder.yudao.module.crm.framework.excel.core.AreaExcelColumnSelectFunction;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.List;

import static cn.iocoder.yudao.module.crm.enums.DictTypeConstants.*;

/**
 * 客户 Excel 导入 VO
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = false) // 设置 chain = false，避免用户导入有问题
@ExcelIgnoreUnannotated // 设置忽略没有ExcelProperty标签的字段
public class CrmCustomerImportExcelVO {

    @ExcelProperty("客户名称")
    private String name;

    @ExcelProperty("手机")
    private String mobile;

    @ExcelProperty("电话")
    private String telephone;

    @ExcelProperty("QQ")
    private String qq;

    @ExcelProperty("微信")
    private String wechat;

    @ExcelProperty("邮箱")
    private String email;

    @ExcelProperty(value = "地区", converter = AreaConvert.class)
    @ExcelColumnSelect(functionName = AreaExcelColumnSelectFunction.NAME)
    private Integer areaId;

    @ExcelProperty("详细地址")
    private String detailAddress;

//    @ExcelProperty(value = "所属行业")
//    @DictFormat(CRM_CUSTOMER_INDUSTRY)
//    @ExcelColumnSelect(dictType = CRM_CUSTOMER_INDUSTRY)
    private String industryId;

    @ExcelProperty(value = "客户等级", converter = DictConvert.class)
    @DictFormat(CRM_CUSTOMER_LEVEL)
    @ExcelColumnSelect(dictType = CRM_CUSTOMER_LEVEL)
    private Integer level;

    @ExcelProperty(value = "客户来源", converter = DictConvert.class)
    @DictFormat(CRM_CUSTOMER_SOURCE)
    @ExcelColumnSelect(dictType = CRM_CUSTOMER_SOURCE)
    private Integer source;

    @ExcelProperty("备注")
    private String remark;


    @ExcelProperty(value = "公司规模", converter = DictConvert.class)
    @DictFormat(CRM_CUSTOMER_COMPANY_SIZE)
    @ExcelColumnSelect(dictType = CRM_CUSTOMER_COMPANY_SIZE)
    private String companySize;
    @ExcelProperty(value = "客户需求", converter = ExcelListDataCovert.class)
    @DictFormat(CRM_CUSTOMER_DEMAND_OPTIONS_GROUP)
    @ExcelColumnSelect(dictType = CRM_CUSTOMER_DEMAND_OPTIONS_GROUP)
    private List<String> customerDemand;
    @ExcelProperty(value = "用电场景", converter = DictConvert.class)
    @ExcelColumnSelect(dictType = CRM_CUSTOMER_ELECTRICITY_USAGE_SCENARIO)
    @DictFormat(CRM_CUSTOMER_ELECTRICITY_USAGE_SCENARIO)
    private String electricityUsageScenario;
    @ExcelProperty(value = "签约难度", converter = DictConvert.class)
    @DictFormat(CRM_CUSTOMER_SIGNING_DIFFICULTY)
    @ExcelColumnSelect(dictType = CRM_CUSTOMER_SIGNING_DIFFICULTY)
    private String signingDifficulty;
    @ExcelProperty(value = "收款难度", converter = DictConvert.class)
    @DictFormat(CRM_CUSTOMER_COLLECT_PAYMENT_DIFFICULTY)
    @ExcelColumnSelect(dictType = CRM_CUSTOMER_COLLECT_PAYMENT_DIFFICULTY)
    private String collectPaymentDifficulty;
    @ExcelProperty(value = "配电行业的了解程度", converter = DictConvert.class)
    @ExcelColumnSelect(dictType = CRM_CUSTOMER_INDUSTRY_UNDERSTANDING_LEVEL)
    @DictFormat(CRM_CUSTOMER_INDUSTRY_UNDERSTANDING_LEVEL)
    private String industryUnderstandingLevel;
    @ExcelProperty(value = "对电费单、用电知识的了解情况", converter = DictConvert.class)
    @DictFormat(CRM_CUSTOMER_KNOWLEDGE_LEVEL)
    @ExcelColumnSelect(dictType = CRM_CUSTOMER_KNOWLEDGE_LEVEL)
    private String knowledgeLevel;

}
